package com.freecloud.javabasics.javap;

/**
 * @Author: maomao
 * @Date: 2019-11-01 09:57
 */
public class StringJavap {

    /**
     * String与StringBuilder
     */
    public void StringAndStringBuilder(){
        String s1 = "111" +  "222";
        StringBuilder s2 = new StringBuilder("111").append("222");

        System.out.println(s1);
        System.out.println(s2);
    }

    public void StringStatic(){
        String s1 = "333";
        String s2 = "444";
        String s3 = s1 + s2;
        String s4 = s1 + "555";
    }

    private static final String STATIC_STRING = "staticString";
    public void StringStatic2(){
        String s1 = "111";
        String s2 = STATIC_STRING + 111;
    }
}
